package hzn;

import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliConfig {
    @Bean(name="alipayClinet")
    public DefaultAlipayClient client(){
        DefaultAlipayClient alipayClient=new DefaultAlipayClient(
          "https://openapi.alipaydev.com/gateway.do",//支付宝网关
          "2016100100639965",//根据这个id支付宝能获取商户的公钥和支付宝私钥
          //下面是商家私钥
          "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCQOCUHdQlXSxTxoJchhYPA14hTi7YNFkzulOM/Q6QW2keOBwmnxXUW27jrSE0AH2GULU7hr8yyrXOzE5aGXNTJIXeamWRdFerB0DysFByxo4xJ1CHAYc9s2/nLjN5JfbK5URI/rungZ7YJIEQukagR8g3t/VpZbJ+dICh/jxsPDnae7qEWEGC6C4oJ+81NAd29UKrNMf+p7kvVLwnOUElFXp9BOaJ6nTLoSNyeX5Qrao2E3BvR0nMqbt8rcYvhTqCul6lqLta3gVw84LShRaeWglNTJdNuBoH2nppw+WI2OXlMD02N1jtUdNp2My9K0GbjtP6c2MsiebwE9hoQtJiRAgMBAAECggEBAIbtsF84tWORYGfsKll3c9wBCo+3n7zAx3tTmwS+gQ/MarPLi9IGYFThfzHJtBjQQ1gBx9JIysfElgHN6r+MrJv8jsz6hDa+4aMw8wK/0lS0QfV03ZsDJ7CeYid5hSLW0lalLeCdAj0sathA8ulq5wbbIwMtTNFrWi4EPz+QoO1E3/4145b92bJOv7DCmGNbwRQfDHtcM7TPtPgEVfAeKAn2BL/Vpo84fN8xbDpaHV9RcCvYGgFnZHoIrE0IxTfCLifX8puwnyq0BiVjhCH65ouQBIiSJV776b5aoUR6BZCFJgfgWfhqJ9aiyu0CKrWebOciicrC4SngSpVz1dNZKNECgYEAyLVM8ORf9ssvUL2uM7QdvR6HkT4ObZ51qYXHrbkrPGP6q0bF6NUlXsjFvKlb9qNKCbgxOhDuEgH2KQQF61T0NwJOE2HApgcsDLZ/Zbu8OUs4cAWAV6Zg9LC7be2ljDqlOHwPgAsd2NLmW/sX6eAVMZPAAz2O8R0jcbC8tDkRjQ0CgYEAt/MI2ESOCW1+xW1HAKtsj78yYNCdegAAFeRuQMmlF++OeExTRjDwa12O3AUSAzDhJGd7ORdxCGi6BJxULJj/geJ45aiwWKGXBz86eh2mnxIQ0TW6b0mI5htWNrMvp1xRnHLmX1zNCLlq6kjMtEOgTBKuMlDrQEvu1yiDQEcTgJUCgYBns/WLShSjaZyK9Va69EehXdLiItRFo2hcLPldM525WFc+hBTiFq92Z/pzXnZb20b3+qnEvNali0nrK177lyuP+KrqrMljf7Us5Gay4+t/FvSUPONxZlAWXfKZ+/5blDmmE8PWfufvDhlkUTqr5tJMiXDeu8HNpyaXKaB25j3BSQKBgQCth89DPkEEMdBS7Qj7X7w1Szh6TrMQgWmTPYCpC9D76JjtcYtpfwd/Ma5wbzQT4Iu0LQ74x91xAmLhsJxTyi3X2M8WUHGz2xS/2G0RAGHMVF2bD2WGUMed1BIb3iRJbPTscxRSyBgAb/Kle/Ho6JcSzNiaTO3xJPD29pgDDkoelQKBgQCv8tt+W7S9WY16w83sVJbNFywqE3fPGAxeF8ByDqVLL+lKzvR2YFlf3Jz7IpGFic0VwBI4p7vmvWCAYPzZQosRU1O+Sr2ZygFCbxcl+ARinbYAP57bQAx7FWSDw4Kcc92cj9JCK5iGaE+179Ltof6eLYzir5Ud2XEduMW8g/eAgQ==",
          "json",
          "utf-8",
          //下面是支付宝公钥
          "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsgi2aVVSiPD0Dxw5Avy+NTIWmAqLxnuBl72wiW31R1L62v6t80Gqi9xcDKgsNPx+zDAgyntLLGl3gQt0eIjOTol/ZKMK2NHbga1DOu1AEAqFGC943MZORknpMVvNaXKzkIrK0V7t6o3pBmbsYzgPHXCCSvNLhjGLio7/TPtXEyg5WTHfZb4sq0adHf6Rcarc+NytR7QhaWu/kkg84Deee3Q0TYLRCt2YyDTZg/4upHHSnKnsE/0KgRjwZkaXwvhzoHSOIhJJM0FhWMUgavwFHjiol1LcppfPhH9cJIZMorB+Z1Z9P4ACTHFKMPRhRVyYrjPdqpaQipknaOXt70xDHQIDAQAB",
          "RSA2"//加密方式
        );
        return alipayClient;
    }
}
